﻿namespace App.Domain.Handlers {
    using System;
    using App.Data;
    using App.Domain.Models;

    public class GetCompany {
        private readonly ICompanyRepository _companyRepository;

        public GetCompany(ICompanyRepository companyRepository) {
            _companyRepository = companyRepository;
        }

        public CompanyModel Execute(Guid companyId) {
            var single = _companyRepository.GetCompany(companyId);

            return new CompanyModel(single.Id, single.CompanyName, single.ShortName, single.DateCreated);
        }
    }
}
